home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 January / macformat46.iso / Shareware Plus / Developers / Library / Grant's CGI Framework / Grant's CGI Framework / Upgrading < prev    next >
Encoding:
Text File  |  1996-09-20  |  2.6 KB  |  49 lines

  1. Grant's CGI Framework
  2. Version 1.0 beta 15, 16
  3.  
  4. There are some very notable changes in this version. They had to be made in order to accommodate compiling for both the WSAPI and the AppleEvent driven CGIs from a single code set.
  5.  
  6. Memory
  7.  
  8. You must not make any direct memory allocation/deallocation calls in your code. This includes NewHandle/Ptr, DisposeHandle/Ptr, malloc, free, etc. SetHandleSize should be safe if you don't grow your handles by much, or only use the handle for a very short period.
  9.  
  10. Within the CustomCGI functions, you may only use these functions to allocate memory:
  11. CGINewHandle, CGINewHandleClear, CGINewPtr, CGINewPtrClear, CGIDisposeHandle and CGIDisposePtr. These functions must all be passed theCGIHdl that the CustomCGI functions receive.
  12.  
  13. Within all other custom code use the functions:
  14. MemoryNewHandle, MemoryNewHandleClear, MemoryNewPtr and MemoryNewPtrClear and the new functions MemoryDisposeHandle and MemoryDisposePtr.
  15.  
  16. These are all functionally equivelant to the Mac Toolbox calls: NewHandle, NewHandleClear, NewPtr, NewPtrClear, DisposeHandle and DisposePtr. However, they involve some extra 'protective wrapping' to ensure memory is handled smoothly.
  17.  
  18.  
  19. Logging
  20.  
  21. The function 'LogWriteEntry' is now the only log call that you can use when compiling as a WSAPI plug-in. It will put a newline character at the end of the string passed to it.
  22.  
  23. All other Logging calls are not supported and may go away in a future version of the framework.
  24.  
  25. The new function 'DisplayString' displays a string to the status window (of the server if using WSAPI). Currently it does nothing when compiling as a CGI (but it will in the future when a status window is added to the framework).
  26.  
  27.  
  28.  
  29. Interface
  30.  
  31. Caution must be taken to ensure that no interface calls are made when compiling as a plug-in. If you want something like a preferences interface, you'll have to generate a separate configuration application (which can also be done with the framework).
  32.  
  33. If you must include interface code in the custom handlers that are used for plug-ins (which you shouldn't do since no interface calls should be made from any but the custom interface functions), wrap it in:
  34.   #if !(kCompilingForWSAPI)
  35.   ...
  36.   #endif
  37. so it won't be included when you compile as a plug-in.
  38.  
  39.  
  40. Resources
  41.  
  42. Keep all of the resources that will not be included in a plug-in (especially interface resources) in the "MyInterface.rsrc" and keep only the resources shared by both the plug-in and application versions of the cgi in the file "MyCustom.rsrc".
  43.  
  44.  
  45. ____________________
  46. StarNine, and WebSTAR are trademarks of StarNine Technologies, Inc.
  47. Grant's CGI Framework is a trademark of Grant Neufeld.
  48. Copyright ©1996 by Grant Neufeld
  49.